<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>"/>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">


//删除
$(".sc_wdm_dis").linkbutton({onClick:function(){
	var rowInfo = $("#wdm_dis").datagrid('getSelected');
	if(rowInfo){
		$.messager.confirm('确认', '您确定要返聘该员工吗？', function(v){
			if(v){
				var LABOR_ID = $("#wdm_dis").datagrid("getSelected").LABOR_ID;
				alert(LABOR_ID);
				$.getJSON("dis_update",{id:LABOR_ID},function(v){
					if(v){
						$('#wdm_dis').datagrid('reload');   
					}else{
						$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
					}
				});
			}
			
		});
	}else{
		$.messager.alert('错误', '对不起，操作失败，没有选中的行');
	}
	
}});

//模糊查询
function doSearch(value,name){
	$('.wdm_dis').datagrid({ url: 'dis_select?name='+value});//重新指定url
    $('.wdm_dis').datagrid('load',{  
   		
    });

}




</script>
	<table id="wdm_dis" class="easyui-datagrid wdm_dis" data-options="
				url:'dis',
				pageList:[2,4,6,8,10],
				pageSize:10,
				pagination:true,
				method:'get',
				fitColumns:true,
				fit:true,
				nowrap:false,
				autoRowHeight:true,
				singleSelect:true,
				striped:true,
				toolbar:'#wdm15_dis'
				">
			<thead>
				<tr>
					<th  data-options="field:'LABOR_ID',width:50,align:'center',hidden:'false'" >职务编号</th>
					<th data-options="field:'STAIN_ID',width:50,align:'center'">员工编号</th>
					<th data-options="field:'STAIN_NAME',width:50,align:'center'">员工名称</th>
					<th data-options="field:'LZYI',width:50,align:'center'">离职原因</th>
					<th data-options="field:'DIMISSION_DATE',width:50,align:'center',
							formatter:function(value,row,index){
							var date = new Date(value);
							return date.toLocaleString();
					}
					">离职日期</th>
					
					
				</tr> 
			</thead>
			<tbody>
			</tbody>
		</table>
		<div id="wdm15_dis">
                <a href="#" class="easyui-linkbutton sc_wdm_dis" id="sc_wdm_dis" data-options="iconCls:'icon-remove',plain:true,text:'返聘',iconAlign:'left'"></a>| 
				搜索内容
				<input id="ss" class="easyui-searchbox sousuo"
						searcher="doSearch" prompt="请输入员工名"
						style="width: 200px; vertical-align: middle;"></input> 
</div>

		
		
</body>
</html> 